﻿using Dapper_Core.Basic;
using Dapper_Core.Table;
using System;
using System.Collections.Generic;
using System.Text;

namespace Dapper_Core.DAL.Impl
{
    public class Sys_User_RoleSysncReference : AbstractSyncReference
    {
        public Sys_User_RoleSysncReference()
        {

        }

        public override void SyncReferenceProperty(BaseModel model)
        {
            base.SyncReferenceProperty(model);

            //表头补全用户
            string userPropertyName = "User";
            KeyValuePair<string, string> pairUser = new KeyValuePair<string, string>("UserCode", "Code");
            //string selectFieldsUser = SelectFieldHelper.GetSelectField("Sys_User");
            base.SyncReferenceProperty<Sys_User>(new List<BaseModel>() { model }, pairUser, userPropertyName);

            //表头补全角色
            string rolePropertyName = "Role";
            KeyValuePair<string, string> pairRole = new KeyValuePair<string, string>("RoleCode", "RoleCode");
            //string selectFieldsRole = SelectFieldHelper.GetSelectField("Sys_Role");
            base.SyncReferenceProperty<Sys_Role>(new List<BaseModel>() { model }, pairRole, rolePropertyName);
        }
    }
}
